<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="../header.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>${systemName }</title>
    <link rel="shortcut icon" href="${contextPath}/resources/favicon.ico"> 
    <link href="${contextPath}/resources/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="${contextPath}/resources/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <!-- Data Tables -->
    <link href="${contextPath}/resources/css/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet">
    <link href="${contextPath}/resources/css/animate.min.css" rel="stylesheet">
    <link href="${contextPath}/resources/css/style.min.css?v=4.1.0" rel="stylesheet">
    
</head>
<body class="gray-bg">
	<div class="wrapper wrapper-content animated fadeInRight">
		<div class="col-lg-12">
			<div class="ibox float-e-margins">
				<div class="ibox-title">
	                <h5>推送消息&nbsp;&nbsp;&nbsp;&nbsp;
	                <span class="text-success">${msg }</span>
	                <span class="text-danger">${errorMsg }</span>
	               	</h5>
	            </div>
	            <div class="ibox-content">
		            <form id="form1" method="post" class="form-horizontal" action="${contextPath}/admin/message/add">
						<div class="form-group"><label class="col-sm-1 control-label">标题</label>
		                    <div class="col-sm-11"><input name="title" id="title" type="text" class="form-control" maxlength="100"></div>
		                </div>
		                <div class="hr-line-dashed"></div>
		                <div class="form-group"><label class="col-sm-1 control-label">内容</label>
		                    <div class="col-sm-11">
				               <script id="editor" name="content" type="text/plain" ></script>
		                    </div>
		                </div>
		                <div class="hr-line-dashed"></div>
		                <div class="form-group"><label class="col-sm-1 control-label">推送</label>
		                	<div class="col-sm-11">
		                		<label> <input type="radio" name="isPush" value="0" checked="checked"> 不推送 </label>&nbsp;&nbsp;&nbsp;&nbsp;
		                		<label> <input type="radio" name="isPush" value="1"> 推送 </label>
		                	</div>
		                </div>
		                <div class="hr-line-dashed"></div>
		                <div class="form-group">
		                	<div class="col-sm-10">
		                	</div>
		                	<div class="col-sm-2">
		                		<input type="button" value="提交并发布" class="btn btn-primary btn-sm" onclick="submitForm()" />
		                	</div>
		                </div>
					</form>
	            </div>
			</div>
		</div>
	</div>
	<!-- SUMMERNOTE -->
	<script src="${contextPath}/resources/js/jquery.min.js"></script>
	<script src="${contextPath}/resources/js/bootstrap.min.js"></script>
	<script type="text/javascript" charset="utf-8" src="${contextPath}/resources/ueditor/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="${contextPath}/resources/ueditor/ueditor.all.min.js"> </script>
    <!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
    <!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
    <script type="text/javascript" charset="utf-8" src="${contextPath}/resources/ueditor/lang/zh-cn/zh-cn.js"></script>
    <script>
        var ue ;
    	$(document).ready(function(){
    		ue = UE.getEditor('editor');
    	});
    	function submitForm(){
			var title = $("#title").val();
			if(title == ""){
				alert("标题不能为空");
				return false;
			}
			var content = ue.getContentTxt();
			if(content == ""){
				alert("内容不能为空");
				return false;
			}
			$("#form1").submit();
	    }
    </script>
</body>
</html>